package com.esdk.sql;

import com.esdk.esdk;

public class RowNumber {
  private String partitionFields;
  private String orderByField;
  private String fieldAlias;
  /** @see OrderBy */
  private String sortType;

  public RowNumber(String partition, String orderBy, String sortType, String fieldAlias) {
    this.partitionFields= partition;
    this.orderByField= orderBy;
    this.fieldAlias= fieldAlias;
    this.sortType= sortType;
  }

  public String toString(){
    return esdk.str.format("ROW_NUMBER() OVER(PARTITION BY {} ORDER BY {} {}) AS {}",partitionFields,orderByField, sortType, fieldAlias);
  }
}
